//获取首页主题内容

import 'package:dio/dio.dart';
import 'package:study_flutter/yzhg/project/http/ShopDioUtils.dart';
import 'package:study_flutter/yzhg/project/shop/config/service_url.dart';

Future<String> getHomePageContent() async {
  print("获取首页数据..............");

  var formData = {"lon": "115.02932", "lat": "35.776189"};
  String homePageData = await ShopDioUtils.getInstance()
      .post(servicePath['homePageContext'], data: formData);
  print(homePageData);
  return homePageData;
}

/*获取首页火爆专区 数据*/
Future<String> getHomePageBelowContent(String page) async {
  print("获取首页数据..............");
  String homePageBelowContent = await ShopDioUtils.getInstance()
      .post(servicePath['homePageBelowConten'], data: page);
  print(homePageBelowContent);
  return homePageBelowContent;
}

/*获取分类页面的数据*/
Future<String> getCategory({data}) async {
  print("获取分类页面的数据..............");
  String category = await ShopDioUtils.getInstance()
      .post(servicePath['getCategory'], data: data);
  print(category);
  return category;
}

/*获取分类商品数据*/
Future<String> getCategoryGoodsData(formData) async {
  print("获取分类商品的数据..............");
  String categoryList = await ShopDioUtils.getInstance()
      .post(servicePath['getMallGoods'], data: formData);
  print(categoryList);
  return categoryList;
}

/*获取商品详情数据*/
Future<String> getGoodsDetailData(goodId) async {
  print("获取商品详情数据...................");
  var formData = {"goodId": goodId};
  String goodsDetail = await ShopDioUtils.getInstance()
      .post(servicePath['getGoodDetailById'], data: formData);
  print(goodsDetail);
  return goodsDetail;
}
